package edu.rit.checkers;

import java.util.ArrayList;


public class Move {
	
	//Starting row/col
	byte sRow;
	byte sCol;
	
	//Ending row/col
	byte eRow;
	byte eCol;

	//Jumped row/col 
	byte jRow;
	byte jCol;

	boolean isJump;
	
	ArrayList<Move> multJumpList;
	
	/**
	 * Object used to represent a move across the checkers board
	 * @param sr starting row
	 * @param sc starting column
	 * @param er ending row
	 * @param ec ending column
	 * @param jump true if it is a jumping move, false otherwise
	 */
	public Move(int sr, int sc, int er, int ec, boolean jump ){
		sRow = (byte)sr;
		sCol = (byte)sc;
		
		eRow = (byte)er;
		eCol  = (byte)ec;
		
		isJump = jump;
		
		multJumpList = new ArrayList<Move>();
		
	}
	
	/**
	 * Object created when multiple jumps are being performed, stores the jumped row and jumped column
	 * @param sr starting row
	 * @param sc starting column
	 * @param er ending row
	 * @param ec ending column
	 * @param jr jumped row
	 * @param jc jumped column
	 * @param jump true if it is a jumping move, false otherwise
	 */
	public  Move(int sr, int sc, int er, int ec, int jr, int jc, boolean jump ){
		sRow = (byte)sr;
		sCol = (byte)sc;
		
		eRow = (byte)er;
		eCol  = (byte)ec;
		
		isJump = jump;
		
		jRow = (byte)jr;
		jCol = (byte)jc;
		multJumpList = new ArrayList<Move>();
	}
	

	public int getSRow(){return sRow;}
	public int getSCol(){return sCol;}
	public int getERow(){return eRow;}
	public int getECol(){return eCol;}
	public int getJRow(){return jRow;}
	public int getJCol(){return jCol;}
	public ArrayList<Move> getMoveList(){return multJumpList;}	
	
	/**
	 * Adds another move to moves internal moves list, this list is used for multiple jumps
	 * @param m move to add
	 */
	public void addToList(Move m){
		multJumpList.add(m);
	}
	

	public int getListSize(){
		return multJumpList.size();
	}
	
}
